1. Field of the Present Invention
The present invention generally relates to data processing systems, and more specifically, to methods and systems for lock instrumentation within the data processing system.
2. History of Related Art
In a multi-processing environment, an operating system executes multiple processes concurrently. A Process, as referred to hereinafter, refers to an operating system entity associated with a unit of work or task.
During the execution of a process, the process may require the use of various resources, such as a CPU, memory, an input/output device, and the like. In a multi-processing environment these resources are shared, thus, conflicts arise between different processes which desire access to the same resource. These conflicts are managed by the operating system through the use of lock data structures and lock functions (primitives).
Currently, the industry has utilized two types of lock data structures, instrumentation and non-instrumentation. Instrumentation lock data structures, typically, include information related to the development of accessories for the operating system, such as device drivers. Non-instrumentation lock data structures are optimized versions of the instrumentation lock data structures, and therefore, are void of any unnecessary development information.
Operating system programs, such as kernel extensions, which use the lock data structures are developed so as to support the use of either the istrumentation or non-instrumentation lock data structures. However, before compilation of the operating system programs, an instrumentation or non-instrumentation lock data structure must be selected.
Currently, lock data structures are, typically, created using a conditional compilation directive for the type definition of the lock data structure. Many high level computer programming languages offer conditional compilation directives, for example, in the C++ computer programming language, one such conditional compilation directive is the C++ "#ifdef". An example of how the "#ifdef" conditional compilation directive can be used to create a lock data structure is illustrated below in TABLE I.
TABLE I ______________________________________ Typedef int variablel; #ifdef instrumentation /** development variables**/ int variable2; int variable3; #endif longint variable4; }lockword; ______________________________________
In this example, the compiler, during compilation, will determine the contents for the data structure "lockword", and therefore, whether the "lockword" is of a instrumentation or non-instrumentation type. If the variable "instrumentation" is set, then the lockword data structure will include variables 1-4 which are used for development. The inclusion of variables 1-4 results in the definement of the lockword data structure as an instrumentation lock data structure. If, however, the variable "instrumentation" is not set, then the lockword data structure will only include variable1 and variable4. Accordingly, the lockword data structure will be defined as a non-instrumentation lock data structure. The advantage of using such a conditional compilation statement is that a common source exists for determining the definition of the lock data structure.
There are, however, several disadvantages associated with using two different lock word data structures. One such disadvantage is that two separate sets of executable files are created for the same operating system. One set of executable files is used for developing accessories for the operating system, and the other set for use by the end user. Hence, the management and coordination of the operating system is doubled. Another such disadvantage, is when a user of the operating system compiled with the non-instrumentation lock data structure requires the additional information stored in the instrumentation lock data structure. Unfortunately, this results in providing the user with the operating system, compiled with the instrumentation lock data structure via shipping or other means. This is cost prohibitive.
It would be a distinct advantage to have a method and system in which a single lock data structure could be used by a caller of the locking functions for use in either the development of accessories or for use by an enduser. The present invention provides such a method and system.